<?php
/**
 * 处理用户登出请求
 *
 */
require_once( './path.php' );

//调用初始化页面
require_once( CLASSMATE_ROOT.'/controller/process_script_init.php' );

//判断用户在线，才可进行此操作
if( session::get('is_online') ){

	 $user_auth_process = unserialize( session::get( 'user_auth_process' ) );
	 
	 if ( $user_auth_process->do_logout() ){
	 
		 $response_message = array(
			 'type' => 'success' , 
			 'content' => '退出登录成功' ,
			 'url_des'=>'返回首页' ,
			 'url' => '/classmate/controller/index.php' );

		 session::set( 'response_message' , $message );

		 header( 'Location: ../response_message.php' );
		 exit();
	 }

}else{

	 $response_message = array( 'type'=>'info' , 'content'=>'你还没有登录，不能进行退出登录操作。' , 'url'=>'../index.php' );
	 session::set( 'response_message' , $response_message );

	 header( 'Location: ../response_message.php' );
	 exit();
}

